package com.tgy.servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/***
 * @ClassName: HelloServlet
 * @Description: 学习Servlet
 * @Auther: 送一一块二向箔
 * @Date: 23:40 2021/12/2
 * @version : V1.0
 */
public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse response) throws  IOException {
//        ServletOutputStream outputStream = response.getOutputStream();
        PrintWriter responseWriter = response.getWriter();//响应流
        responseWriter.print("hello,com.tgy.servlet");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        super.doGet(req, resp);
    }
}
